Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #49 and #51, might have performance implications #54

Closed
wants to merge 16 commits into from

Conversation

thisiscam
Copy link

@thisiscam thisiscam commented Sep 8, 2019

An attempt to fix #49 and #51

The problem (I think) was that the MutationObserver is somehow interfering with the keyboard space key event. Since the MutationObserver was applied on $(#message_container)s, in Threads view, this also included the input text field attached to each thread.

In this pull request, I resorted to using DOMNodeInserted event, which doesn't seem to cause trouble with keyboard (though according to internet this should be deprecated for performance reason). As a compensation (I hope), in the event handler, I only attached IntersectionObserver which watches for DOM entry, and then mathjax the relevant pieces of text (instead of the entire message container as before).

Edit:
Just realized that https://github.com/thisiscam/math-with-slack/blob/v3/math-with-slack.py#L184 also hacks away the problem of Slack rewriting the local settings file.
Hacky but one-liner is always worth it 💯

@thisiscam thisiscam changed the title fix threads view, might have performance implications Fix #49 and #51, might have performance implications Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants